<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>

    </style>
</head>

<body>

    <div id="box">


    </div>


    <script src="./js/react.js"></script>
    <script src="./js/react-dom.js"></script>
    <script src="./js/babel.min.js"></script>

    <script type="text/babel">

        // 定义一个函数式组件：

        function CommonSay() {

            let msg="hello"

            return (
                <div>
                    <p>
                        <input type="radio" /><span>吃了吗</span>
                    </p>
                    <p>
                        <input type="radio" /><span>睡了吗</span>
                    </p>
                    <p>
                        <input type="radio" /><span>在干嘛</span>
                    </p>
                    <p>
                        <input type="radio" /><span>{msg}</span>
                    </p>
                </div>
            )
        }

        // 定义一个类组件：

        class Chat extends React.Component{

            constructor(){
                super();
               this.title="2212班"
            }
            
            render(){
                return (
                    <div>
                        <h1>{this.title}的聊天室</h1>
                        <div style={{width:"200px",height:"400px","border":"1px solid red"}}>
                        </div>
                        <input type="text" />
                        <input type="button" value="发送" />      
                                    
                    </div>
                )
            }
        }

        const book = (<div>
            <h1>组件：</h1>
            <Chat />    
            <CommonSay/>   
        </div>
        );

        ReactDOM.render(book, document.getElementById("box"));


    </script>
</body>

</html>